package net.lab0.fractal.fractals.mandelbrot;

public class MandelbrotQuadTreeZoneInfo
{
    enum NodeStatus
    {
        VOID, // the node was never browsed
        BROWSED, // the node was browsed but was neither completely inside nor outside
        INSIDE, // the node is completely inside the mandelbrot set
        OUTSIDE // the node is completely inside the mandelbrot set
    }
    
    private NodeStatus status;
    private long       minIter;
    private long       maxIter;
    
    public MandelbrotQuadTreeZoneInfo()
    {
        this.maxIter = -1;
        this.minIter = -1;
        this.status = NodeStatus.VOID;
    }
    
    public MandelbrotQuadTreeZoneInfo(NodeStatus status, long minIter, long maxIter)
    {
        super();
        this.status = status;
        if (status == NodeStatus.OUTSIDE)
        {
            this.minIter = minIter;
            this.maxIter = maxIter;
        }
        else
        {
            this.maxIter = -1;
            this.minIter = -1;
        }
    }
    
    public boolean isInside()
    {
        return status == NodeStatus.INSIDE;
    }
    
    public boolean isBorder()
    {
        return status == NodeStatus.BROWSED;
    }
    
    public boolean isOutside()
    {
        return status == NodeStatus.OUTSIDE;
    }
    
    public long getMinIter()
    {
        return minIter;
    }
    
    public long getMaxIter()
    {
        return maxIter;
    }
    
}
